package app.util.image.action
{
	import app.util.*;
	
	import flash.display.*;
	import flash.filters.ConvolutionFilter;
	import flash.geom.*;
	
	public class ConvAction extends AbstractAction
	{	
		private var data:Array;
			
		public function ConvAction(d:Array)
		{
			this.data = d;
		}
		
		public override function getDescription():String
		{
			return "Customized Convolution";
		}
		
		public override function getActionedBitmapData():BitmapData
		{
			var old:BitmapData = Mediator.getCurrentBitmapData();
			var ret:BitmapData = old.clone();
			var filter:ConvolutionFilter = new ConvolutionFilter(3, 3, this.data);
			ret.applyFilter(ret, ret.rect, new Point(0, 0), filter);
			return ret;
		}
	}
}